﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Pattern_Iterator
{
    class Program
    {
        static void Main(string[] args)
        {
            Aggregate1 aggregare1 = new Aggregate1();
            aggregare1[0] = "大鸟";
            aggregare1[1] = "小菜";
            aggregare1[2] = "行李";
            aggregare1[3] = "老外";
            aggregare1[4] = "内部员工";
            aggregare1[5] = "小偷";

            Iterator i = new Iterator1(aggregare1);

            object item = i.First();

            while (!i.IsDone())
            {
                Console.WriteLine("{0} 请买车票!", i.CurrentItem());
                i.Next();
            }
        }
    }
}
